#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
#include <string>
#include <map>

struct com
{
    bool operator()(const pair<string, int>& p1, const pair<string, int>& p2)
    {
        if (p1.second > p2.second)
            return true;
        if (p1.second == p2.second && p1.first > p2.first)
            return true;
        return false;
    }
};

int main() {
    string str;
    getline(cin, str);
    map<string, int, com> count;

    int l = 0, r = 0;
    for (r = 0; r < str.size(); ++r)
    {
        if (str[r] == ' ' || str[r] == '.')
        {
            string tmp = str.substr(l, r - l);
            int i = 0;
            for (i = 0; i < tmp.size(); ++i)
            {
                if (isupper(tmp[i]))
                {
                    tmp[i] = tolower(tmp[i]);
                }
            }
            count[tmp]++;
        }
        l = r + 1;
    }

    for (auto& e : count)
    {
        cout << e.first << ":" << e.second << endl;
    }

    return 0;
}